$.validator.setDefaults({
	highlight: function(e) {
		$(e).closest(".form-group").removeClass("has-success").addClass("has-error")
	},
	success: function(e) {
		e.closest(".form-group").removeClass("has-error").addClass("has-success")
	},
	errorElement: "span",
	errorPlacement: function(e, r) {
		e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
	},
	errorClass: "help-block m-b-none",
	validClass: "help-block m-b-none"
}), $().ready(function() {
	$("#commentForm").validate();
	var e = "<i class='fa fa-times-circle'></i> ";
	$("#signupForm").validate({
		rules: {
			user_name: {
				required: !0
			},
			true_name: {
				required: !0
			},
			inviteruser: {
				required: !0
			},
			treeuser: {
				required: !0
			},
			reportuser: {
				required: !0
			},
			PassWordOne1: {
				required: !0,
				min:6
			},
			PassWordOne2: {
				required: !0,
				equalTo: '#PassWordOne1' 
			},
			
			PassWordTwo1: {
				required: !0,
				min:6
			},
			PassWordTwo2: {
				required: !0,
				equalTo: '#PassWordTwo1'
			},
			bank_name: {
				required: !0
			},
			bank_code: {
				required: !0
			}
			
		},
		messages: {
			user_name: {
				required: e + "用户名不能为空"
			},
			true_name: {
				required: e + "姓名不能为空"
			},
			inviteruser: {
				required: e + "请正确输入推荐人ID号"
			},
			treeuser: {
				required: e + "请正确输入接点人ID号"
			},
			reportuser: {
				required: e + "请正确输入商务中心ID号"
			},
			PassWordOne1: {
				required: e + "登录密码不能为空",
				min: e + '登录密码最少6位'
			},
			PassWordOne2: {
				required: e + "请输入确认密码",
				equalTo:  e + '确认登录密码与登录密码不同'
			},
			
			PassWordTwo1: {
				required: e + "安全密码不能为空",
				min: e + '安全密码最少6位'
			},
			PassWordTwo2: {
				required: e + "请输入确认安全密码",
				equalTo:  e + '确认安全密码与安全密码不同'
			},
			bank_name: {
				required: e + "请输入支行信息"
			},
			bank_code: {
				required: e + "请输入您的银行卡号"
			}
		}
	})
});